package com.google.code.yargon.engine;

/**
 * Class to simulate dice or generate random values between given range
 * 
 * 4.2.2012 - added method to get random value from given set --huru 
 * 11.2.2012 - changed methods to static --huru
 * 
 * 
 *	@author Tuomas Oinonen, Mika Myllynen
 */

public class Cast extends RandGen{
	public static int castDice(int seed){
		return randBtw(seed,1);
	}
	public static int castValueBetween(int intFrom, int intTo ){
		return randBtw(intFrom,intTo);
	}
	
	/**
	 * Return a random value from given set<br><br>
	 * Call example:<br>
	 * <pre>
	 * int r = cast.castFromSet(1,4,8,16);
	 * </pre>
	 * r is a random number from set [1,4,8,16]
	 * @param values
	 * @return
	 */
	public static int castFromSet(int ... values) {
		return values[randBtw(0, values.length - 1)];
	}
}
